/*
 * Copyright (C) 2011 : Gilles Coomans 
 * 
 * This file is part of QuintEssence.
 * QuintEssence is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * QuintEssence is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with QuintEssence.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.exprom.qe;
import net.exprom.qe.fields.QEField;

/**
 * ...
 * @author Gilles Coomans
 */

 typedef QEEvaluationContext = { 
	root:Dynamic,
	parent:Dynamic,
	metas:Dynamic
};

interface IQELayerable 
{
	var rootContext:IQELayerable;
	var parent:IQELayerable;
	var name:String;
	var namespace:String;
	var path:String;
	
	function setNamespace(ns:String, name:String = null):Void;
	function applyLayer(layer:Dynamic, up:Bool = true):Void;
	//function applyStack(model:Dynamic, up:Bool = true):Void;
	function applyStack(stack:QEStack, up:Bool = true):Void;
	function applyMetasModel(fieldName:String, model:Dynamic, up:Bool = true):Void;
	function getField(fieldName:String):Dynamic;
	
	function clone():Dynamic;
	function compil():Void;
	
	function validate():Bool;
	function finalStruct(includeMetas:Bool = false, fixEvaluation:Bool = false, validateLeafs:Bool = false):Dynamic;
	function fixEvaluables():Void;
	function toXML(query:Dynamic = null):Xml; 	
	function resetLeafs():Void;
}


